package com.liuyucheng.idea_springboot.spring;

import com.liuyucheng.idea_springboot.bean.Lyc;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyConfig {

    @Bean(name = "lyc")
    public Lyc getLyc(){
        return new Lyc().setName("鼠标").setId(1);
    }

    @Bean(name = "mybean",initMethod = "init")
    public MyBean getMyBean(){
        return new MyBean().setBeanName("我的bean").setClassName("com.liuyucheng.idea_springboot.spring.MyBean");
    }

}
